package com.xuecheng.content.controller;

import com.xuecheng.api.content.CourseBaseApi;
import com.xuecheng.api.content.model.qo.CourseBaseDTO;
import com.xuecheng.api.content.model.qo.QueryCourseModel;
import com.xuecheng.common.domain.page.PageRequestParams;
import com.xuecheng.common.domain.page.PageVO;
import com.xuecheng.common.util.SecurityUtil;
import com.xuecheng.content.service.CourseBaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

public class CourseBaseController implements CourseBaseApi {
    @Autowired
    private CourseBaseService courseBaseService;


    @Override
    @PostMapping("course/list")
    public PageVO queryCourselist(PageRequestParams params, @RequestBody QueryCourseModel model) {
        Long companyId = SecurityUtil.getCompanyId();


        PageVO< CourseBaseDTO > pageVo = courseBaseService.queryCourseList(params, model, companyId);

        return pageVo;
    }
}
